package cn.tedu.baidashi.mapper;

import cn.tedu.baidashi.model.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tedu.cn
 * @since 2022-02-12
 */
@Repository
public interface CustomerMapper extends BaseMapper<Customer> {
    //通过customerMapper，来进行与数据库的连接
    @Select("select * from customer where customer_name=#{username};")
    Customer findCustomerByCustomerName(String username);

    @Select("SELECT customer.id FROM customer WHERE customer.customer_name=#{customerName};")
    Customer findIdByCustomerName(String customerName);

}
